<template>
    <div>
        <div v-if="this.$store.state.login.platform===''">
            <user-nav text="余额提现" icon="#icon-card" color="#BF2071" @click.native="inCome(balance)"></user-nav>
            <div class="line"></div>
        </div>
        <user-nav text="余额转账" icon="#icon-zhuanzhang" color="#BF2071" @click.native="inTrans"></user-nav>
        <div class="line"></div>
    </div>
</template>
<div>
</div>
<script>
    import userNav from '../../components/common/userNav';

    export default {
        /**
         * 使用余额
         */
        name: 'useAmount',
        components: {userNav},
        data() {
            return {};
        },
        created() {
        },
        methods: {
            inCome(val) {
                //    去提现
                if (this.$store.state.login.platform !== '') {
                    this.$toast({
                        message: '请关注爱润妍技术部公众号，通过商城入口登录后进行提现操作',
                        duration: 2000
                    });
                    return;
                }
                this.$router.push({
                    name: 'withDraw',
                    query: {
                        balance: val
                    }
                });
            },
            inTrans() {
                //    去转账
                this.$router.push({
                    name: 'transa'
                });
            }
        },
        mounted() {
            this.balance = this.$route.query.balance;
        }

    };
</script>

<style scoped lang="stylus" rel="stylesheet/stylus">
    @import '~assets/main.styl'
</style>
